<!--
 * @Description: 
 * @Version: 1.0
 * @Autor: gaoluo
 * @Date: 2021-08-20 13:57:04
 * @LastEditors: gaoluo
 * @LastEditTime: 2021-11-11 17:37:10
 * @FilePath: /nhw/src/views/Profile/index.vue
-->
<template>
  <div class="profile-container">
    <!-- 头像 -->
    <div class="personage">
      <div class="userinfo">
        <div class="avatar">
          <VanImage
            width="1.33rem"
            height="1.33rem"
            :src="'/nhw/' + userinfo.avatar"
            round
            fit="cover"
          >
            <template #error>
              <img src="https://img01.yzcdn.cn/vant/cat.jpeg" />
            </template>
          </VanImage>
        </div>
        <div class="info">
          <p class="username">{{ userinfo.userName }}</p>
          <p class="department">
            <span>所在部门:</span>{{ userinfo.departName }}
          </p>
        </div>
      </div>
    </div>
    <!-- 所在风景区 -->
    <div class="scenic-area">
      <span>
        <Icon class-prefix="iconfont" name="weizhi" size=".53rem" />
        所在景区</span
      >
      <span>无锡拈花湾</span>
    </div>
    <!-- 我的服务 -->
    <div class="personal-service">
      <span>我的服务</span>
      <Cell
        title="个人信息"
        is-link
        icon-prefix="iconfont"
        icon="gerenxinxi"
        size=".53rem"
        to="/profile/information"
      />
      <Cell
        title="我的积分"
        is-link
        icon-prefix="iconfont"
        icon="jifen"
        size=".53rem"
        to="/profile/points"
      />
      <Cell
        title="设置"
        is-link
        icon-prefix="iconfont"
        icon="shezhi"
        size=".53rem"
        to="/profile/settings"
      />
    </div>
  </div>
</template>

<script>
import { Image as VanImage, Icon, Cell } from "vant";
export default {
  name: "Profile",

  components: { VanImage, Icon, Cell },

  data() {
    return {
      userinfo: {},
    };
  },

  activated() {
    this.userinfo = JSON.parse(window.localStorage.getItem("userInfo"));
  },
  methods: {},
};
</script>

<style lang="less" scoped>
@import "~style/var.less";
@import "~assets/font/font.less";
.profile-container {
  .personage {
    height: 350px;
    width: 100%;
    background: url("~assets/img/avatar-bg@2x.png") no-repeat;
    background-position-y: -90px;
    background-size: 100%;
    box-sizing: border-box;
    overflow: hidden;
    .userinfo {
      display: flex;
      align-items: center;
      margin-top: 110px;
      margin-left: 47px;
      .avatar {
        .van-image {
          box-sizing: border-box;
          border: 4px solid;
          color: @primary;
          img {
            width: 100%;
            height: 100%;
            object-fit: cover;
          }
        }
      }
      .info {
        margin-left: 18px;
        .username {
          color: #3a3a3a;
          font-size: 32px;
        }

        .department {
          line-height: 2;
          color: #8f7d6d;
          font-size: 26px;
        }
      }
    }
  }

  .scenic-area {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 710px;
    height: 95px;
    margin: -10px auto 44px;
    color: #fff;
    font-size: 32px;
    border-radius: 10px;
    background-image: url("~assets/img/arcline.png"),
      linear-gradient(90deg, #696d73 0%, #a2a2a2 100%);
    background-repeat: no-repeat;
    background-size: 100% 100%;

    .iconfont {
      padding: 10px;
      background: #fff;
      border-radius: 50%;
      margin-left: 30px;
      color: #b3b3b3;
      vertical-align: middle;
    }
    span + span {
      margin-right: 30px;
    }
  }

  .personal-service {
    .van-cell {
      font-size: 28px;
      color: #4f4f4f;
      padding-right: 10px;
      padding-left: 1.2em;
    }
    & > span {
      display: inline-block;
      text-indent: 1em;
      color: #313131;
      font-size: 30px;
      font-weight: bold;
    }
    .iconfont,
    .van-icon {
      font-size: 40px;
      color: #a6a6a6;
    }
  }
}
</style>